Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Migration Report - #4310

Merged
brthor merged 1 commit into
dotnet:rel/1.0.0from
brthor:brthor/migrationreport
Oct 7, 2016
Merged

brthor merged 1 commit into
dotnet:rel/1.0.0from
brthor:brthor/migrationreport

Conversation

@brthor

@brthor brthor commented Oct 4, 2016 •

Copy link
Copy Markdown

@livarcocc @srivatsn @333fred

/cc @eerhardt @Sridhar-MS @blackdwarf

The migration report including options for outputting to a file or stdout in a user friendly or json format.

Fixes: #4165
Fixes: #4164

Successful Example:

screen shot 2016-10-04 at 3 09 17 pm

Failure Example:

screen shot 2016-10-04 at 3 30 01 pm

@333fred 333fred left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good to me, thanks for the work @brthor. This unblocks dotnet/project-system#507.

using System.Linq;
namespace Microsoft.DotNet.ProjectJsonMigration
{
public class ProjectMigrationReport

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


public bool AllSucceeded => ! ProjectMigrationReports.Any(p => p.Errors.Any());

public MigrationReport MergeReport(MigrationReport otherReport)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


WriteReport(migrationReport);

return 0;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

if (projectMigrationReport.Errors.Any())
{
sb.AppendLine($"Project {projectMigrationReport.ProjectName} migration failed ({projectMigrationReport.ProjectDirectory})");
sb.AppendLine(string.Join("\n", projectMigrationReport.Errors.Select(e => e.GetFormattedErrorMessage())));

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

}
else
{
sb.AppendLine($"Project {projectMigrationReport.ProjectName} migration succeeded ({projectMigrationReport.ProjectDirectory})");

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

{
public static string GetProjectName(this ProjectContext projectContext)
{
return Path.GetFileNameWithoutExtension(projectContext.GetOutputPaths("_").CompilationFiles.Assembly);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

{
public static string GetProjectName(this ProjectContext projectContext)
{
return Path.GetFileNameWithoutExtension(projectContext.GetOutputPaths("_").CompilationFiles.Assembly);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


public int SucceededProjectsCount => ProjectMigrationReports.Count(p => !p.Errors.Any());

public int FailedProjectsCount => ProjectMigrationReports.Count(p => p.Errors.Any());

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

ProjectDirectory = projectDirectory;
ProjectName = projectName;
OutputMSBuildProject = outputMSBuildProject;
Errors = errors ?? Enumerable.Empty<MigrationError>().ToList();

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


public List<MigrationError> Errors { get; }

public List<string> Warnings { get; }

This comment was marked as spam.

This comment was marked as spam.

@eerhardt

eerhardt commented Oct 5, 2016

Copy link
Copy Markdown
Member

:shipit:

@brthor

brthor commented Oct 6, 2016

Copy link
Copy Markdown
Author

Added changes to also tackle https://github.com/dotnet/cli/issues/4164
Addressed all feedback
Please take another pass on Code review.

@brthor

brthor commented Oct 6, 2016 •

Copy link
Copy Markdown
Author

New Samples: (Also writing to stderr/stdout)

screen shot 2016-10-05 at 5 40 53 pm

screen shot 2016-10-05 at 5 41 13 pm

@brthor

brthor commented Oct 6, 2016

Copy link
Copy Markdown
Author

test Windows_NT x64 Release Build

@brthor
brthor force-pushed the brthor/migrationreport branch from 7a41f26 to fbaf9a6 Compare October 6, 2016 23:02
@brthor

brthor commented Oct 6, 2016

Copy link
Copy Markdown
Author

test Windows_NT x64 Release Build

@brthor
brthor merged commit 2727b19 into dotnet:rel/1.0.0 Oct 7, 2016
@brthor
brthor deleted the brthor/migrationreport branch October 7, 2016 18:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants